package cn.softgame.cms.secure.role.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.softgame.cms.open.authentication.domain.SysModule;
import cn.softgame.cms.secure.role.domain.RoleBean;
import cn.softgame.cms.secure.role.persistence.RoleMapper;
import cn.softgame.cms.secure.user.domain.User;


@Service
public class RoleServiceImpl implements RoleService {
	
	@Autowired
	private RoleMapper mapper;
	
	@Override
	public List<RoleBean> queryAllRoles(RoleBean role) {
		return mapper.queryAllRoles(role);
	}
	
	@Override
	public Integer roleCount(RoleBean role) {
		return mapper.roleCount(role);
	}

	@Override
	public List<User> getUsersByRoleId(String roleId) {
		return mapper.getUsersByRoleId(roleId);
	}

	@Override
	public List<SysModule> getSysModulesByRoleId(String roleId) {
		return mapper.getSysModulesByRoleId(roleId);
	}

	@Override
	public List<User> roleUsers(User user) {
		return mapper.roleUsers(user);
	}

	@Override
	public Integer roleUsersTotal(User user) {
		return mapper.roleUsersTotal(user);
	}

	
	
}
